Add some drawing information the migration guide
authorMatthias Clasen <mclasen@redhat.com>
Fri, 18 Nov 2016 12:42:49 +0000 (07:42 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 18 Nov 2016 12:43:33 +0000 (07:43 -0500)
Mention snapshot(), and the new GtkDrawingArea API.

docs/reference/gtk/migrating-3to4.xml

index 2638c7d9dcdc51ce7150046b1d194acfa4de15a0..e8ce2aaaef80c39e2fad2860a1c915d1f2bdaed7 100644 (file)
       </para>
     </section>
 
+    <section>
+      <title>Adapt to drawing model changes</title>
+      <para>
+        This area has seen the most radical changes in the transition from GTK+ 3
+        to GTK+ 4. Widgets no longer use a draw() function to render their contents
+        to a cairo surface. Instead, they have a snapshot() function that creates
+        one or more GskRenderNodes to represent their content. Third-party widgets
+        that use a draw() function or a #GtkWidget::draw signal handler for custom
+        drawing will need to be converted to use gtk_snapshot_append_cairo_node().
+      </para>
+      <para>
+        The auxiliary #GtkSnapshot object has APIs to help with creating render
+        nodes.
+      </para>
+      <para>
+        If you are using a #GtkDrawingArea for custom drawing, you need to switch
+        to using gtk_drawing_area_set_draw_func() to set a draw function. This is
+        pretty much a direct replacement for a #GtkWidget::draw signal handler.
+      </para>
+    </section>
+
   </section>
 
 </chapter>